package cn.hzw.supermarket.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;

import cn.hzw.supermarket.R;
import cn.hzw.supermarket.databinding.ActivityAboutBinding;

public class AboutActivity extends AppCompatActivity {
    private ActivityAboutBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //全屏，隐藏标题
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        binding = ActivityAboutBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        initView();
    }

    private void initView() {
        binding.layoutTitle.tvTitle.setText("关于我们");
        binding.layoutTitle.ivBack.setOnClickListener(view -> {
            finish();
        });
        //超市简介
        binding.content.setOnClickListener(view -> {
            Intent intent = new Intent(this,ShoppingContentActivity.class);
            startActivity(intent);
        });
        //检测更新
        binding.version.setOnClickListener(view -> {
            Toast.makeText(this, "无更新，当前版本为1.0.0", Toast.LENGTH_SHORT).show();
        });
        //服务条款
        binding.server.setOnClickListener(view -> {
            Intent intent = new Intent(this,ServerClauseActivity.class);
            startActivity(intent);
        });
        //隐私政策
        binding.privacy.setOnClickListener(view -> {
            Toast.makeText(this, "该功能尚未实现", Toast.LENGTH_SHORT).show();
        });
        //营业执照
        binding.license.setOnClickListener(view -> {
            Intent intent = new Intent(this,TradeLicenseActivity.class);
            startActivity(intent);
        });
    }
}